package com.zhangfuyin.aop;

import org.springframework.aop.MethodBeforeAdvice;
import org.springframework.aop.framework.ProxyFactoryBean;
import org.springframework.stereotype.Component;

import java.lang.reflect.Method;

@Component("myAdvice")
public class MethodBeforeAdviceImpl implements MethodBeforeAdvice {

    @Override
    public void before(Method method, Object[] objects, Object o) throws Throwable {
        if(!method.getName().equals("toString")){
            System.out.println("*****************开启事务=============");
        }

    }
}



